package cinvestav.adviseme.webservice;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import cinvestav.adviseme.datamodel.Error;

@Provider
public class WSErrorMapper implements ExceptionMapper<WSErrorException>{
	
	    public Response toResponse(WSErrorException e) {
	        return Response.status(404).
	                entity(new Error(e.getMessage())).
	                type("application/json").
	                build();
	    }

}
